/*
 * AsesorPortatilView.java
 */
package asesorportatil;

import asesorportatil.marcaApple.AsesorApple;
import asesorportatil.marcaDell.AsesorDell;
import asesorportatil.marcaLenovo.AsesorLenovo;
import asesorportatil.marcaSonyVaio.AsesorVaio;
import java.awt.Component;
import java.awt.Container;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Iterator;
import javax.swing.DefaultListModel;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;

/**
 * Ventana principal de la aplicacion
 */
public class AsesorPortatilView extends FrameView {

    AsesorLenovo asesorLenovo;
    AsesorApple asesorApple;
    AsesorVaio asesorVaio;
    AsesorDell asesorDell;
    MotorJess motorJess;

    public AsesorPortatilView(SingleFrameApplication app) {
        super(app);

        motorJess = new MotorJess();
        initComponents();
        DisableContainer(jPanel1);
        DisableContainer(jScrollPane1);

        // status bar initialization - message timeout, idle icon and busy animation, etc
        ResourceMap resourceMap = getResourceMap();
        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
        messageTimer = new Timer(messageTimeout, new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                statusMessageLabel.setText("");
            }
        });
        messageTimer.setRepeats(false);
        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
        for (int i = 0; i < busyIcons.length; i++) {
            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
        }
        busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            }
        });
        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        statusAnimationLabel.setIcon(idleIcon);
        progressBar.setVisible(false);

        // connecting action tasks to status bar via TaskMonitor
        TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
        taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {

            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                String propertyName = evt.getPropertyName();
                if ("started".equals(propertyName)) {
                    if (!busyIconTimer.isRunning()) {
                        statusAnimationLabel.setIcon(busyIcons[0]);
                        busyIconIndex = 0;
                        busyIconTimer.start();
                    }
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(true);
                } else if ("done".equals(propertyName)) {
                    busyIconTimer.stop();
                    statusAnimationLabel.setIcon(idleIcon);
                    progressBar.setVisible(false);
                    progressBar.setValue(0);
                } else if ("message".equals(propertyName)) {
                    String text = (String) (evt.getNewValue());
                    statusMessageLabel.setText((text == null) ? "" : text);
                    messageTimer.restart();
                } else if ("progress".equals(propertyName)) {
                    int value = (Integer) (evt.getNewValue());
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(false);
                    progressBar.setValue(value);
                }
            }
        });
    }

    @Action
    public void showAboutBox() {
        if (aboutBox == null) {
            JFrame mainFrame = AsesorPortatilApp.getApplication().getMainFrame();
            aboutBox = new AsesorPortatilAboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        AsesorPortatilApp.getApplication().show(aboutBox);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        mainPanel1 = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jCheckBox5 = new javax.swing.JCheckBox();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jCheckBox6 = new javax.swing.JCheckBox();
        jTextField1 = new javax.swing.JTextField();
        jTextField2 = new javax.swing.JTextField();
        jTextField3 = new javax.swing.JTextField();
        jTextField4 = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jCheckBox7 = new javax.swing.JCheckBox();
        jTextField5 = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jTextField6 = new javax.swing.JTextField();
        jCheckBox8 = new javax.swing.JCheckBox();
        jLabel11 = new javax.swing.JLabel();
        jTextField7 = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jTextField8 = new javax.swing.JTextField();
        jCheckBox9 = new javax.swing.JCheckBox();
        jLabel13 = new javax.swing.JLabel();
        jTextField9 = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jTextField10 = new javax.swing.JTextField();
        jCheckBox10 = new javax.swing.JCheckBox();
        jLabel15 = new javax.swing.JLabel();
        jTextField11 = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jTextField12 = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jCheckBox11 = new javax.swing.JCheckBox();
        jCheckBox12 = new javax.swing.JCheckBox();
        jCheckBox13 = new javax.swing.JCheckBox();
        jComboBox3 = new javax.swing.JComboBox();
        jComboBox4 = new javax.swing.JComboBox();
        jComboBox5 = new javax.swing.JComboBox();
        jComboBox1 = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        jComboBox2 = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jCheckBox4 = new javax.swing.JCheckBox();
        jCheckBox3 = new javax.swing.JCheckBox();
        jCheckBox2 = new javax.swing.JCheckBox();
        jCheckBox1 = new javax.swing.JCheckBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        jList1 = new javax.swing.JList();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        menuBar = new javax.swing.JMenuBar();
        javax.swing.JMenu fileMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
        javax.swing.JMenu helpMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
        statusPanel = new javax.swing.JPanel();
        javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
        statusMessageLabel = new javax.swing.JLabel();
        statusAnimationLabel = new javax.swing.JLabel();
        progressBar = new javax.swing.JProgressBar();
        frameResultados = new javax.swing.JFrame();
        jScrollPane2 = new javax.swing.JScrollPane();
        areaResultados = new javax.swing.JTextArea();
        frameResultados1 = new javax.swing.JFrame();
        jScrollPane3 = new javax.swing.JScrollPane();
        areaResultados1 = new javax.swing.JTextArea();

        mainPanel.setMinimumSize(new java.awt.Dimension(1000, 600));
        mainPanel.setName("mainPanel"); // NOI18N
        mainPanel.setPreferredSize(new java.awt.Dimension(1000, 600));

        mainPanel1.setName("mainPanel1"); // NOI18N
        mainPanel1.setPreferredSize(new java.awt.Dimension(504, 275));

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel1.setName("jPanel1"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(asesorportatil.AsesorPortatilApp.class).getContext().getResourceMap(AsesorPortatilView.class);
        jCheckBox5.setText(resourceMap.getString("jCheckBox5.text")); // NOI18N
        jCheckBox5.setName("jCheckBox5"); // NOI18N

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        jCheckBox6.setText(resourceMap.getString("jCheckBox6.text")); // NOI18N
        jCheckBox6.setName("jCheckBox6"); // NOI18N

        jTextField1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTextField1.setName("jTextField1"); // NOI18N

        jTextField2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTextField2.setName("jTextField2"); // NOI18N

        jTextField3.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTextField3.setName("jTextField3"); // NOI18N

        jTextField4.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTextField4.setName("jTextField4"); // NOI18N

        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N

        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N

        jCheckBox7.setText(resourceMap.getString("jCheckBox7.text")); // NOI18N
        jCheckBox7.setName("jCheckBox7"); // NOI18N

        jTextField5.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTextField5.setName("jTextField5"); // NOI18N

        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N

        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N

        jTextField6.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTextField6.setName("jTextField6"); // NOI18N

        jCheckBox8.setText(resourceMap.getString("jCheckBox8.text")); // NOI18N
        jCheckBox8.setName("jCheckBox8"); // NOI18N

        jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
        jLabel11.setName("jLabel11"); // NOI18N

        jTextField7.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTextField7.setName("jTextField7"); // NOI18N

        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N

        jTextField8.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTextField8.setName("jTextField8"); // NOI18N

        jCheckBox9.setText(resourceMap.getString("jCheckBox9.text")); // NOI18N
        jCheckBox9.setName("jCheckBox9"); // NOI18N

        jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
        jLabel13.setName("jLabel13"); // NOI18N

        jTextField9.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTextField9.setName("jTextField9"); // NOI18N

        jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
        jLabel14.setName("jLabel14"); // NOI18N

        jTextField10.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTextField10.setName("jTextField10"); // NOI18N

        jCheckBox10.setText(resourceMap.getString("jCheckBox10.text")); // NOI18N
        jCheckBox10.setName("jCheckBox10"); // NOI18N

        jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
        jLabel15.setName("jLabel15"); // NOI18N

        jTextField11.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTextField11.setName("jTextField11"); // NOI18N

        jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
        jLabel16.setName("jLabel16"); // NOI18N

        jTextField12.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTextField12.setName("jTextField12"); // NOI18N

        jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
        jLabel17.setName("jLabel17"); // NOI18N

        jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
        jLabel18.setName("jLabel18"); // NOI18N

        jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
        jLabel19.setName("jLabel19"); // NOI18N

        jLabel20.setText(resourceMap.getString("jLabel20.text")); // NOI18N
        jLabel20.setName("jLabel20"); // NOI18N

        jLabel21.setText(resourceMap.getString("jLabel21.text")); // NOI18N
        jLabel21.setName("jLabel21"); // NOI18N

        jLabel22.setText(resourceMap.getString("jLabel22.text")); // NOI18N
        jLabel22.setName("jLabel22"); // NOI18N

        jCheckBox11.setText(resourceMap.getString("jCheckBox11.text")); // NOI18N
        jCheckBox11.setName("jCheckBox11"); // NOI18N

        jCheckBox12.setText(resourceMap.getString("jCheckBox12.text")); // NOI18N
        jCheckBox12.setName("jCheckBox12"); // NOI18N

        jCheckBox13.setText(resourceMap.getString("jCheckBox13.text")); // NOI18N
        jCheckBox13.setName("jCheckBox13"); // NOI18N

        jComboBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Windows7_64bits", "Windows7_32bits", "MacOsX", "Ubuntu_8.04" }));
        jComboBox3.setName("jComboBox3"); // NOI18N

        jComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Estándar", "Media", "Larga" }));
        jComboBox4.setName("jComboBox4"); // NOI18N

        jComboBox5.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1 año", "2 años" }));
        jComboBox5.setName("jComboBox5"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jCheckBox9)
                            .addComponent(jCheckBox10)
                            .addComponent(jCheckBox8)
                            .addComponent(jCheckBox7)
                            .addComponent(jCheckBox6)
                            .addComponent(jCheckBox5))
                        .addGap(34, 34, 34)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel15, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel9, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel13, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING)))
                    .addComponent(jCheckBox11)
                    .addComponent(jCheckBox12)
                    .addComponent(jCheckBox13))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel16)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel22))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel20))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel19))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel21))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel6)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel8)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel18)
                            .addComponent(jLabel17)))
                    .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(20, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17)
                    .addComponent(jLabel6)
                    .addComponent(jCheckBox5))
                .addGap(9, 9, 9)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7)
                    .addComponent(jLabel18)
                    .addComponent(jLabel8)
                    .addComponent(jCheckBox6))
                .addGap(9, 9, 9)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10)
                    .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel19)
                    .addComponent(jCheckBox7))
                .addGap(11, 11, 11)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12)
                    .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel20)
                    .addComponent(jCheckBox8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13)
                    .addComponent(jLabel14)
                    .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel21)
                    .addComponent(jCheckBox9))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel15)
                    .addComponent(jLabel16)
                    .addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22)
                    .addComponent(jCheckBox10))
                .addGap(10, 10, 10)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jCheckBox11))
                .addGap(11, 11, 11)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jCheckBox12))
                .addGap(14, 14, 14)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jCheckBox13))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "uso", "características", "modelo" }));
        jComboBox1.setName("jComboBox1"); // NOI18N
        jComboBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox1ActionPerformed(evt);
            }
        });

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Multimedia", "Ultraportátil", "Juegos", "Estación de trabajo" }));
        jComboBox2.setName("jComboBox2"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.setName("jPanel2"); // NOI18N

        jCheckBox4.setText(resourceMap.getString("jCheckBox4.text")); // NOI18N
        jCheckBox4.setName("jCheckBox4"); // NOI18N

        jCheckBox3.setText(resourceMap.getString("jCheckBox3.text")); // NOI18N
        jCheckBox3.setName("jCheckBox3"); // NOI18N

        jCheckBox2.setText(resourceMap.getString("jCheckBox2.text")); // NOI18N
        jCheckBox2.setName("jCheckBox2"); // NOI18N

        jCheckBox1.setText(resourceMap.getString("jCheckBox1.text")); // NOI18N
        jCheckBox1.setName("jCheckBox1"); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jCheckBox4)
                    .addComponent(jCheckBox1)
                    .addComponent(jCheckBox3)
                    .addComponent(jCheckBox2))
                .addContainerGap(40, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jCheckBox1)
                .addGap(18, 18, 18)
                .addComponent(jCheckBox2)
                .addGap(18, 18, 18)
                .addComponent(jCheckBox3)
                .addGap(18, 18, 18)
                .addComponent(jCheckBox4)
                .addContainerGap(263, Short.MAX_VALUE))
        );

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jList1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jList1.setName("jList1"); // NOI18N
        jScrollPane1.setViewportView(jList1);

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout mainPanel1Layout = new javax.swing.GroupLayout(mainPanel1);
        mainPanel1.setLayout(mainPanel1Layout);
        mainPanel1Layout.setHorizontalGroup(
            mainPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(mainPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(mainPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(mainPanel1Layout.createSequentialGroup()
                        .addGroup(mainPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(mainPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel1)
                                .addGap(10, 10, 10)
                                .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBox2, 0, 0, Short.MAX_VALUE))
                            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3))
                        .addGap(18, 18, 18)
                        .addGroup(mainPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 287, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        mainPanel1Layout.setVerticalGroup(
            mainPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(mainPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(mainPanel1Layout.createSequentialGroup()
                        .addGroup(mainPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(22, 22, 22)
                        .addGroup(mainPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(jLabel4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(mainPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)
                            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton1))
                    .addGroup(mainPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 1017, Short.MAX_VALUE)
            .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
                    .addContainerGap(127, Short.MAX_VALUE)
                    .addComponent(mainPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 878, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()))
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 576, Short.MAX_VALUE)
            .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(mainPanelLayout.createSequentialGroup()
                    .addGap(40, 40, 40)
                    .addComponent(mainPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 457, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(79, Short.MAX_VALUE)))
        );

        menuBar.setName("menuBar"); // NOI18N

        fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
        fileMenu.setName("fileMenu"); // NOI18N

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(asesorportatil.AsesorPortatilApp.class).getContext().getActionMap(AsesorPortatilView.class, this);
        exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
        exitMenuItem.setName("exitMenuItem"); // NOI18N
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
        helpMenu.setName("helpMenu"); // NOI18N

        aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
        aboutMenuItem.setName("aboutMenuItem"); // NOI18N
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        statusPanel.setName("statusPanel"); // NOI18N

        statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N

        statusMessageLabel.setName("statusMessageLabel"); // NOI18N

        statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N

        progressBar.setName("progressBar"); // NOI18N

        javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
        statusPanel.setLayout(statusPanelLayout);
        statusPanelLayout.setHorizontalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 1017, Short.MAX_VALUE)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(statusMessageLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 833, Short.MAX_VALUE)
                .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(statusAnimationLabel)
                .addContainerGap())
        );
        statusPanelLayout.setVerticalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(statusMessageLabel)
                    .addComponent(statusAnimationLabel)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(3, 3, 3))
        );

        frameResultados.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        frameResultados.setName("frameResultados"); // NOI18N

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        areaResultados.setColumns(20);
        areaResultados.setRows(5);
        areaResultados.setName("areaResultados"); // NOI18N
        jScrollPane2.setViewportView(areaResultados);

        javax.swing.GroupLayout frameResultadosLayout = new javax.swing.GroupLayout(frameResultados.getContentPane());
        frameResultados.getContentPane().setLayout(frameResultadosLayout);
        frameResultadosLayout.setHorizontalGroup(
            frameResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 734, Short.MAX_VALUE)
        );
        frameResultadosLayout.setVerticalGroup(
            frameResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 405, Short.MAX_VALUE)
        );

        frameResultados1.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        frameResultados1.setTitle(resourceMap.getString("frameResultados1.title")); // NOI18N
        frameResultados1.setName("frameResultados1"); // NOI18N

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        areaResultados1.setColumns(20);
        areaResultados1.setRows(5);
        areaResultados1.setName("areaResultados1"); // NOI18N
        jScrollPane3.setViewportView(areaResultados1);

        javax.swing.GroupLayout frameResultados1Layout = new javax.swing.GroupLayout(frameResultados1.getContentPane());
        frameResultados1.getContentPane().setLayout(frameResultados1Layout);
        frameResultados1Layout.setHorizontalGroup(
            frameResultados1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 734, Short.MAX_VALUE)
        );
        frameResultados1Layout.setVerticalGroup(
            frameResultados1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 405, Short.MAX_VALUE)
        );

        setComponent(mainPanel);
        setMenuBar(menuBar);
        setStatusBar(statusPanel);
    }// </editor-fold>//GEN-END:initComponents

    private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
        if (jComboBox1.getSelectedIndex() == 0) {
            jComboBox2.setEnabled(true);
            DisableContainer(jPanel1);
            DisableContainer(jScrollPane1);
        } else if (jComboBox1.getSelectedIndex() == 1) {
            jComboBox2.setEnabled(false);
            EnableContainer(jPanel1);
            DisableContainer(jScrollPane1);
        } else {
            DefaultListModel model = new DefaultListModel();
            areaResultados.setText("");
            if (jCheckBox1.isSelected()) {
                asesorLenovo = new AsesorLenovo();
                ArrayList<String> resultado;
                Iterator it;
                motorJess.reset();
                motorJess.ejecutarConsulta(asesorLenovo.getComandos());
                resultado = asesorLenovo.obtenerListaPortatiles(motorJess.getM_rete());
                it = resultado.iterator();
                while (it.hasNext()) {
                    model.addElement(it.next().toString());
                }
            }
            if (jCheckBox2.isSelected()) {
                asesorVaio = new AsesorVaio();
                ArrayList<String> resultado;
                Iterator it;
                motorJess.reset();
                motorJess.ejecutarConsulta(asesorVaio.getComandos());
                resultado = asesorVaio.obtenerListaPortatiles(motorJess.getM_rete());
                it = resultado.iterator();
                while (it.hasNext()) {
                    model.addElement(it.next().toString());
                }
            }
            if (jCheckBox3.isSelected()) {
                asesorDell = new AsesorDell();
                ArrayList<String> resultado;
                Iterator it;
                motorJess.reset();
                motorJess.ejecutarConsulta(asesorDell.getComandos());
                resultado = asesorDell.obtenerListaPortatiles(motorJess.getM_rete());
                it = resultado.iterator();
                while (it.hasNext()) {
                    model.addElement(it.next().toString());
                }
            }
            if (jCheckBox4.isSelected()) {
                asesorApple = new AsesorApple();
                ArrayList<String> resultado;
                Iterator it;
                motorJess.reset();
                motorJess.ejecutarConsulta(asesorApple.getComandos());
                resultado = asesorApple.obtenerListaPortatiles(motorJess.getM_rete());
                it = resultado.iterator();
                while (it.hasNext()) {
                    model.addElement(it.next().toString());
                }
            }

            DisableContainer(jPanel1);
            EnableContainer(jScrollPane1);
            jComboBox2.setEnabled(false);
            jList1.setModel(model);
        }
    }

    void EnableContainer(Container c) {
        Component[] components = c.getComponents();

        for (int i = 0; i < components.length; i++) {
            components[i].setEnabled(true);
            if (components[i] instanceof Container) {
                EnableContainer((Container) components[i]);
            }
        }
    }

    void DisableContainer(Container c) {
        Component[] components = c.getComponents();

        for (int i = 0; i < components.length; i++) {
            components[i].setEnabled(false);
            if (components[i] instanceof Container) {
                DisableContainer((Container) components[i]);
            }
        }
    }//GEN-LAST:event_jComboBox1ActionPerformed

    private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed
//        asesorLenovo = new AsesorLenovo();
//        caracteristicaPredefinido();
//        caracteristicaPrecio();
//        caracteristicaPantalla();
//        caracteristicaRAM();
//        caracteristicaBateria();
//        caracteristicaGarantía();
//        caracteristicaDiscoDuro();
//        caracteristicaTarjetaGraf();
//        caracteristicaCPU();
//        caracteristicaSO();
//
//        boolean marcaLenovo = true;
//
//        ArrayList<String> resultado;
//        Iterator it;
//        areaResultados.setText("");
//
//        if (marcaLenovo) {
//            motorJess.reset();
//            motorJess.ejecutarConsulta(asesorLenovo.getComandos());
//            resultado = asesorLenovo.devolverResultados(motorJess.getM_rete());
//
//            it = resultado.iterator();
//            while (it.hasNext()) {
//                areaResultados.append("\n***************************************************************\n");
//                areaResultados.append(it.next().toString());
//                areaResultados.append("\n***************************************************************\n");
//            }
//        }
//
//        if (areaResultados.getText().isEmpty()) {
//            areaResultados.append("\n***************************************************************\n");
//            areaResultados.append("NO EXISTEN PORTÁTILES CON LAS CARACTERÍSTICAS INDICADAS");
//            areaResultados.append("\n***************************************************************\n");
//        }
//        frameResultados.setVisible(true);
//        frameResultados.pack();
    }//GEN-LAST:event_jToggleButton1ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        asesorLenovo = new AsesorLenovo();
        asesorApple = new AsesorApple();
        asesorVaio = new AsesorVaio();
        asesorDell = new AsesorDell();

        ArrayList<String> resultado;
        ArrayList<Portatil> portatiles;
        Iterator it;
        areaResultados.setText("");

        //Busqueda por caracteristicas
        if (jComboBox1.getSelectedIndex() == 1) {
            if (jCheckBox5.isSelected()) {
                caracteristicaPrecio();
            }
            if (jCheckBox6.isSelected()) {
                caracteristicaPantalla();
            }
            if (jCheckBox7.isSelected()) {
                caracteristicaRAM();
            }
            if (jCheckBox12.isSelected()) {
                caracteristicaBateria();
            }
            if (jCheckBox13.isSelected()) {
                caracteristicaGarantía();
            }
            if (jCheckBox8.isSelected()) {
                caracteristicaDiscoDuro();
            }
            if (jCheckBox10.isSelected()) {
                caracteristicaTarjetaGraf();
            }
            if (jCheckBox9.isSelected()) {
                caracteristicaCPU();
            }
            if (jCheckBox11.isSelected()) {
                caracteristicaSO();
            }


            boolean buscarLenovo;
            if (jCheckBox1.isSelected()) {
                buscarLenovo = true;
            } else {
                buscarLenovo = false;
            }

            boolean buscarApple;
            if (jCheckBox4.isSelected()) {
                buscarApple = true;
            } else {
                buscarApple = false;
            }

            boolean buscarVaio;
            if (jCheckBox2.isSelected()) {
                buscarVaio = true;
            } else {
                buscarVaio = false;
            }

            boolean buscarDell;
            if (jCheckBox3.isSelected()) {
                buscarDell = true;
            } else {
                buscarDell = false;
            }

            if (buscarLenovo) {
                motorJess.reset();
                motorJess.ejecutarConsulta(asesorLenovo.getComandos());
                resultado = asesorLenovo.devolverResultados(motorJess.getM_rete());

                it = resultado.iterator();
                while (it.hasNext()) {
                    areaResultados.append("\n***************************************************************\n");
                    areaResultados.append(it.next().toString());
                    areaResultados.append("\n***************************************************************\n");
                }
            }

            if (buscarApple) {
                motorJess.reset();
                motorJess.ejecutarConsulta(asesorApple.getComandos());
                resultado = asesorApple.devolverResultados(motorJess.getM_rete());

                it = resultado.iterator();
                while (it.hasNext()) {
                    areaResultados.append("\n***************************************************************\n");
                    areaResultados.append(it.next().toString());
                    areaResultados.append("\n***************************************************************\n");
                }
            }

            if (buscarVaio) {
                motorJess.reset();
                motorJess.ejecutarConsulta(asesorVaio.getComandos());
                resultado = asesorVaio.devolverResultados(motorJess.getM_rete());

                it = resultado.iterator();
                while (it.hasNext()) {
                    areaResultados.append("\n***************************************************************\n");
                    areaResultados.append(it.next().toString());
                    areaResultados.append("\n***************************************************************\n");
                }
            }

            if (buscarDell) {
                motorJess.reset();
                motorJess.ejecutarConsulta(asesorDell.getComandos());
                resultado = asesorDell.devolverResultados(motorJess.getM_rete());

                it = resultado.iterator();
                while (it.hasNext()) {
                    areaResultados.append("\n***************************************************************\n");
                    areaResultados.append(it.next().toString());
                    areaResultados.append("\n***************************************************************\n");
                }
            }

            if (areaResultados.getText().isEmpty()) {
                areaResultados.append("\n***************************************************************\n");
                areaResultados.append("NO EXISTEN PORTÁTILES CON LAS CARACTERÍSTICAS INDICADAS");
                areaResultados.append("\n***************************************************************\n");
            }
        } //Busqueda por nombre
        else if (jComboBox1.getSelectedIndex() == 2) {
            String elegido = (String) jList1.getSelectedValue();
            motorJess.reset();
            if (jCheckBox1.isSelected()) {
                motorJess.ejecutarConsulta(asesorLenovo.getComandos());
                portatiles = asesorLenovo.obtenerTodosLosDatos(motorJess.getM_rete());
                for (int i = 0; i < portatiles.size(); i++) {
                    if (portatiles.get(i).getModelo().equals(elegido)) {
                        Portatil porta = portatiles.get(i);
                        String descripcion = ""
                                + "Portatil  " + porta.getMarca()
                                + "\nProcesador  de " + porta.getCores() + " a " + porta.getVelocidad() + " GHz"
                                + "\nRam: " + porta.getRam() + "GB"
                                + "\nPantalla " + porta.getPantalla() + " pulgadas"
                                + "\nDisco Duro de  " + porta.getDisco() + " GB"
                                + "\nSistema Operativo: " + porta.getSo()
                                + "\nDuración de la bateria: " + porta.getDuracionBateria() + " Horas"
                                + "\nTarjeta Grafica " + porta.getTarjetaGrafica()
                                + "\nGarantia: " + porta.getGarantia()
                                + "\nPrecio : " + porta.getPrecio() + " Euros";
                        areaResultados.append("\n***************************************************************\n");
                        areaResultados.append(descripcion);
                        areaResultados.append("\n***************************************************************\n");
                    }
                }
            }
            if (jCheckBox2.isSelected()) {
                motorJess.ejecutarConsulta(asesorVaio.getComandos());
                portatiles = asesorVaio.obtenerTodosLosDatos(motorJess.getM_rete());
                for (int i = 0; i < portatiles.size(); i++) {
                    if (portatiles.get(i).getNombre().equals(elegido)) {
                        Portatil porta = portatiles.get(i);
                        String descripcion = ""
                                + "Portatil  " + porta.getMarca()
                                + "\nNombre " + porta.getNombre()
                                + "\nProcesador " + porta.getProcesador() + " de " + porta.getCores() + " a " + porta.getVelocidad() + " GHz"
                                + "\nRam: " + porta.getRam() + "GB"
                                + "\nPantalla " + porta.getPantalla() + " pulgadas"
                                + "\nDisco Duro de  " + porta.getDisco() + " GB"
                                + "\nSistema Operativo: " + porta.getSo()
                                + "\nDuración de la bateria: " + porta.getDuracionBateria() + " Horas"
                                + "\nTarjeta Grafica " + porta.getTarjetaGrafica() + "de " + porta.getMemGrafica() + " Mb"
                                + "\nGarantia: " + porta.getGarantia()
                                + "\nPrecio : " + porta.getPrecio() + " Euros";
                        areaResultados.append("\n***************************************************************\n");
                        areaResultados.append(descripcion);
                        areaResultados.append("\n***************************************************************\n");
                    }
                }
            }
            if (jCheckBox3.isSelected()) {
                motorJess.ejecutarConsulta(asesorDell.getComandos());
                portatiles = asesorDell.obtenerTodosLosDatos(motorJess.getM_rete());
                for (int i = 0; i < portatiles.size(); i++) {
                    if (portatiles.get(i).getFamilia().equals(elegido)) {
                        Portatil porta = portatiles.get(i);
                        String descripcion = ""
                                + "Portatil  " + porta.getMarca()
                                + "\nFamilia " + porta.getFamilia()
                                + "\nProcesador " + porta.getProcesador() + " de " + porta.getCores() + " a " + porta.getVelocidad() + " GHz"
                                + "\nRam: " + porta.getRam() + "GB"
                                + "\nPantalla " + porta.getPantalla() + " pulgadas"
                                + "\nDisco Duro de  " + porta.getDisco() + " GB"
                                + "\nSistema Operativo: " + porta.getSo()
                                + "\nDuración de la bateria: " + porta.getDuracionBateria() + " Horas"
                                + "\nTarjeta Grafica " + porta.getTarjetaGrafica() + "de " + porta.getMemGrafica() + " Mb"
                                + "\nGarantia: " + porta.getGarantia()
                                + "\nPrecio : " + porta.getPrecio() + " Euros";
                        areaResultados.append("\n***************************************************************\n");
                        areaResultados.append(descripcion);
                        areaResultados.append("\n***************************************************************\n");
                    }
                }
            }
            if (jCheckBox4.isSelected()) {
                motorJess.ejecutarConsulta(asesorApple.getComandos());
                portatiles = asesorApple.obtenerTodosLosDatos(motorJess.getM_rete());
                for (int i = 0; i < portatiles.size(); i++) {
                    if (portatiles.get(i).getModelo().equals(elegido)) {
                        Portatil porta = portatiles.get(i);
                        String descripcion = ""
                                + "Portatil  " + porta.getMarca()
                                + "\nModelo " + porta.getModelo()
                                + "\nProcesador a " + porta.getVelocidad() + " GHz"
                                + "\nRam: " + porta.getRam() + "GB"
                                + "\nPantalla " + porta.getPantalla() + " pulgadas"
                                + "\nDisco Duro de  " + porta.getDisco() + " GB"
                                + "\nSistema Operativo: " + porta.getSo()
                                + "\nDuración de la bateria: " + porta.getDuracionBateria() + " Horas"
                                + "\nTarjeta Grafica de " + porta.getMemGrafica() + " Mb"
                                + "\nGarantia: " + porta.getGarantia()
                                + "\nWeb: " + porta.getWeb()
                                + "\nPrecio : " + porta.getPrecio() + " Euros";
                        areaResultados.append("\n***************************************************************\n");
                        areaResultados.append(descripcion);
                        areaResultados.append("\n***************************************************************\n");
                    }
                }
            }
        } else {
            caracteristicaPredefinido(jComboBox2.getSelectedIndex());
            boolean buscarLenovo;
            if (jCheckBox1.isSelected()) {
                buscarLenovo = true;
            } else {
                buscarLenovo = false;
            }

            boolean buscarApple;
            if (jCheckBox4.isSelected()) {
                buscarApple = true;
            } else {
                buscarApple = false;
            }

            boolean buscarVaio;
            if (jCheckBox2.isSelected()) {
                buscarVaio = true;
            } else {
                buscarVaio = false;
            }

            boolean buscarDell;
            if (jCheckBox3.isSelected()) {
                buscarDell = true;
            } else {
                buscarDell = false;
            }

            if (buscarLenovo) {
                motorJess.reset();
                motorJess.ejecutarConsulta(asesorLenovo.getComandos());
                resultado = asesorLenovo.devolverResultados(motorJess.getM_rete());

                it = resultado.iterator();
                while (it.hasNext()) {
                    areaResultados.append("\n***************************************************************\n");
                    areaResultados.append(it.next().toString());
                    areaResultados.append("\n***************************************************************\n");
                }
            }

            if (buscarApple) {
                motorJess.reset();
                motorJess.ejecutarConsulta(asesorApple.getComandos());
                resultado = asesorApple.devolverResultados(motorJess.getM_rete());

                it = resultado.iterator();
                while (it.hasNext()) {
                    areaResultados.append("\n***************************************************************\n");
                    areaResultados.append(it.next().toString());
                    areaResultados.append("\n***************************************************************\n");
                }
            }

            if (buscarVaio) {
                motorJess.reset();
                motorJess.ejecutarConsulta(asesorVaio.getComandos());
                resultado = asesorVaio.devolverResultados(motorJess.getM_rete());

                it = resultado.iterator();
                while (it.hasNext()) {
                    areaResultados.append("\n***************************************************************\n");
                    areaResultados.append(it.next().toString());
                    areaResultados.append("\n***************************************************************\n");
                }
            }

            if (buscarDell) {
                motorJess.reset();
                motorJess.ejecutarConsulta(asesorDell.getComandos());
                resultado = asesorDell.devolverResultados(motorJess.getM_rete());

                it = resultado.iterator();
                while (it.hasNext()) {
                    areaResultados.append("\n***************************************************************\n");
                    areaResultados.append(it.next().toString());
                    areaResultados.append("\n***************************************************************\n");
                }
            }

            if (areaResultados.getText().isEmpty()) {
                areaResultados.append("\n***************************************************************\n");
                areaResultados.append("NO EXISTEN PORTÁTILES CON LAS CARACTERÍSTICAS INDICADAS");
                areaResultados.append("\n***************************************************************\n");
            }
        }

        frameResultados.setVisible(true);
        frameResultados.pack();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void caracteristicaPredefinido(int opcion) {
        if (opcion == 0) {//Multimedia, Ultraportátil, Juegos, Estación de trabajo
            asesorVaio.caracteristicaPredefinido("Multimedia");
            asesorLenovo.caracteristicaPredefinido("Multimedia");
            asesorApple.caracteristicaPredefinido("Multimedia");
            asesorDell.caracteristicaPredefinido("Multimedia");
        } else if (opcion == 1) {
            asesorVaio.caracteristicaPredefinido("Ultraportátil");
            asesorLenovo.caracteristicaPredefinido("Ultraportátil");
            asesorApple.caracteristicaPredefinido("Ultraportátil");
            asesorDell.caracteristicaPredefinido("Ultraportátil");
        } else if (opcion == 2) {
            asesorVaio.caracteristicaPredefinido("Juegos");
            asesorLenovo.caracteristicaPredefinido("Juegos");
            asesorApple.caracteristicaPredefinido("Juegos");
            asesorDell.caracteristicaPredefinido("Juegos");
        } else {
            asesorVaio.caracteristicaPredefinido("Estación de trabajo");
            asesorLenovo.caracteristicaPredefinido("Estación de trabajo");
            asesorApple.caracteristicaPredefinido("Estación de trabajo");
            asesorDell.caracteristicaPredefinido("Estación de trabajo");
        }
}

private void

caracteristicaPrecio() {
        double precioMin = Double.parseDouble(jTextField2.getText());


double precioMax = Double.parseDouble(jTextField1.getText());
        asesorLenovo.

caracteristicaPrecio(precioMin, precioMax);
        asesorApple.

caracteristicaPrecio(precioMin, precioMax);
        asesorVaio.

caracteristicaPrecio(precioMin, precioMax);
        asesorDell.

caracteristicaPrecio(precioMin, precioMax);


}private void caracteristicaPantalla() {
        double pantallaMin = Double.parseDouble(jTextField4.getText());


double pantallaMax = Double.parseDouble(jTextField3.getText());
        asesorLenovo.

caracteristicaPantalla(pantallaMin, pantallaMax);
        asesorApple.

caracteristicaPantalla(pantallaMin, pantallaMax);
        asesorVaio.

caracteristicaPantalla(pantallaMin, pantallaMax);
        asesorDell.

caracteristicaPantalla(pantallaMin, pantallaMax);


}private void caracteristicaRAM() {
        int RAMMin = Integer.parseInt(jTextField6.getText());


int RAMMax = Integer.parseInt(jTextField5.getText());
        asesorLenovo.

caracteristicaRAM(RAMMin, RAMMax);
        asesorApple.

caracteristicaRAM(RAMMin, RAMMax);
        asesorVaio.

caracteristicaRAM(RAMMin, RAMMax);
        asesorDell.

caracteristicaRAM(RAMMin, RAMMax);


}private void caracteristicaBateria() {
        int batMin = 2;


int batMax = 3;


if (jComboBox4.getSelectedIndex() == 1) {
            batMin = 3;
            batMax

= 4;


} else if (jComboBox4.getSelectedIndex() == 2) {
            batMin = 4;
            batMax

= 15;


}
        asesorLenovo.caracteristicaBateria(batMin, batMax);
        asesorApple.

caracteristicaBateria(batMin, batMax);
        asesorVaio.

caracteristicaBateria(batMin, batMax);
        asesorDell.

caracteristicaBateria(batMin, batMax);


}private void caracteristicaGarantía() {
        int garantiaMin = 1;


if (jComboBox5.getSelectedIndex() == 1) {
            garantiaMin = 2;


}
        asesorLenovo.caracteristicaGarantía(garantiaMin);
        asesorApple.

caracteristicaGarantía(garantiaMin);
        asesorVaio.

caracteristicaGarantía(garantiaMin);
        asesorDell.

caracteristicaGarantía(garantiaMin);


}private void caracteristicaDiscoDuro() {
        int discoMin = Integer.parseInt(jTextField8.getText());


int discoMax = Integer.parseInt(jTextField7.getText());
        asesorLenovo.

caracteristicaDiscoDuro(discoMin, discoMax);
        asesorApple.

caracteristicaDiscoDuro(discoMin, discoMax);
        asesorVaio.

caracteristicaDiscoDuro(discoMin, discoMax);
        asesorDell.

caracteristicaDiscoDuro(discoMin, discoMax);


}private void caracteristicaTarjetaGraf() {
        if (jCheckBox10.isSelected()) {
            int tarjetaMin = Integer.parseInt(jTextField12.getText());


int tarjetaMax = Integer.parseInt(jTextField11.getText());
            asesorVaio.

caracteristicaTarjetaGraf(tarjetaMin, tarjetaMax);
            asesorDell.

caracteristicaTarjetaGraf(tarjetaMin, tarjetaMax);
            asesorApple.

caracteristicaTarjetaGraf(tarjetaMin, tarjetaMax);
            //El asesor Lenovo no proporciona este tipo de busqueda


}
    }

    private void caracteristicaCPU() {
        double vCPUMin = Double.parseDouble(jTextField10.getText());


double vCPUMax = Double.parseDouble(jTextField9.getText());
        asesorLenovo.

caracteristicaCPU(vCPUMin, vCPUMax);
        asesorApple.

caracteristicaCPU(vCPUMin, vCPUMax);
        asesorVaio.

caracteristicaCPU(vCPUMin, vCPUMax);
        asesorDell.

caracteristicaCPU(vCPUMin, vCPUMax);


}

    private void caracteristicaSO() {
        asesorLenovo.caracteristicaSO(jComboBox3.getSelectedItem().toString());
        asesorApple.

caracteristicaSO(jComboBox3.getSelectedItem().toString());
        asesorVaio.

caracteristicaSO(jComboBox3.getSelectedItem().toString());
        asesorDell.

caracteristicaSO(jComboBox3.getSelectedItem().toString());


}
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextArea areaResultados;
    private javax.swing.JTextArea areaResultados1;
    private javax.swing.JFrame frameResultados;
    private javax.swing.JFrame frameResultados1;
    private javax.swing.JButton jButton1;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JCheckBox jCheckBox10;
    private javax.swing.JCheckBox jCheckBox11;
    private javax.swing.JCheckBox jCheckBox12;
    private javax.swing.JCheckBox jCheckBox13;
    private javax.swing.JCheckBox jCheckBox2;
    private javax.swing.JCheckBox jCheckBox3;
    private javax.swing.JCheckBox jCheckBox4;
    private javax.swing.JCheckBox jCheckBox5;
    private javax.swing.JCheckBox jCheckBox6;
    private javax.swing.JCheckBox jCheckBox7;
    private javax.swing.JCheckBox jCheckBox8;
    private javax.swing.JCheckBox jCheckBox9;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JComboBox jComboBox3;
    private javax.swing.JComboBox jComboBox4;
    private javax.swing.JComboBox jComboBox5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JList jList1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField10;
    private javax.swing.JTextField jTextField11;
    private javax.swing.JTextField jTextField12;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField5;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JTextField jTextField7;
    private javax.swing.JTextField jTextField8;
    private javax.swing.JTextField jTextField9;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JPanel mainPanel1;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JProgressBar progressBar;
    private javax.swing.JLabel statusAnimationLabel;
    private javax.swing.JLabel statusMessageLabel;
    private javax.swing.JPanel statusPanel;
    // End of variables declaration//GEN-END:variables
    private final Timer

messageTimer;
    private final Timer

busyIconTimer;
    private final Icon

idleIcon;
    private final Icon[

] busyIcons = new Icon[15];
    private int

busyIconIndex = 0;
    private JDialog

aboutBox;

}
